/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.yonsei.iwb.smarttv.gui;

import edu.yonsei.iwb.smarttv.LocalOntologySearch;
import edu.yonsei.iwb.smarttv.LocalOntologySearchInterface;
import edu.yonsei.iwb.smarttv.index.IndexType;
import edu.yonsei.iwb.smarttv.index.OntologyIndexer;
import edu.yonsei.iwb.smarttv.jena.ext.JenaModelType;
import edu.yonsei.iwb.smarttv.model.SMARTTVModel;
import edu.yonsei.iwb.smarttv.util.SMARTTVLog;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.WindowConstants;

/**
 *
 * @author Soo
 */
public class SearchSystemDemo {
    public static void main(String args[]) {
        try {
            for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (Exception ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }

        final MainFrame frame = new MainFrame();
        frame.setVisible(true);
        frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
        WindowListener l = new WindowAdapter(){
            public void windowClosing(WindowEvent e){
                int confirm = JOptionPane.showOptionDialog(frame, "Really Exit?", "Exit Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
                if(confirm == 0){
                    frame.dispose();
                    System.exit(0);
                }
            }
        };
        frame.addWindowListener(l);

    }
}
